<%@page import="java.util.Map"%>
<%@page import="com.nc.solutions.rentacar.domain.car.ICar"%>
<%@page import="com.nc.solutions.rentacar.manager.Impl.CarManager"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
   <head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>JSP Page</title>
		<link rel="stylesheet" type="text/css" href="jquery/calendar/cal.css" />
		<script language="JavaScript" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
		<script language="javascript" type="text/javascript" src="jquery/calendar/cal.js"></script>
		<script type="text/javascript">
			$(document).ready(function(){
				$('#calendarFrom').simpleDatepicker(); 
				$('#calendarTo').simpleDatepicker();// Привязать вызов календаря к полю с CSS идентификатором #calendar
			});
		</script>
	</head>
	<body>
		<h1>Welcome to CarRent.
			<br>
			Choose your destiny!
			</br>
		</h1>
		<form name="Submit" action="ClientServlet">
			DateFrom : <input id="calendarFrom" name="dateFrom" value="" type="text"/>
			DateTo : <input id="calendarTo" name="dateTo" value="" type="text"/></br>
			Select car : 
			<select name="carselect" size="1">
				<%
				CarManager cMgr = new CarManager();
				cMgr.test();
				Map<Integer, ICar> cars = cMgr.getCarMap();
				for(int car:cars.keySet()){
					String name = cars.get(car).getNumber();
				%>
				<option value="/<%=car%>/"><%=name%></option>
				<%}%>
			</select>
			</br>
			Input Your Name : <input type="text" name="user" value="" size="30"/></br>
			<input type="submit" value="Get Result" name="Submit" />
		</form>
	</body>
</html>
